//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.emin.platform.productCenter.controller;

import com.emin.platform.productCenter.entity.Person;
import com.emin.platform.productCenter.service.PersonService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Autowired
    PersonService personService;

    public TestController() {
    }

    @RequestMapping(
            value = {"/test"},
            method = {RequestMethod.GET}
    )
    public String login(@RequestParam(value = "id", required = true) Long id, @RequestParam(value
            = "mobilePhone", required = true) String mobilePhone, @RequestParam(value =
            "password", required = true) String password) {
        Person person = this.personService.login(mobilePhone, password);
        return null != person ? JSONObject.fromObject(person).toString() : "fail";
    }
}
